package com.menu.system.service.impl;

import java.util.List;
import com.menu.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.menu.system.mapper.MenuTrainingMapper;
import com.menu.system.domain.MenuTraining;
import com.menu.system.service.IMenuTrainingService;

/**
 * 培训信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-10
 */
@Service
public class MenuTrainingServiceImpl implements IMenuTrainingService 
{
    @Autowired
    private MenuTrainingMapper menuTrainingMapper;

    /**
     * 查询培训信息
     * 
     * @param trainId 培训信息主键
     * @return 培训信息
     */
    @Override
    public MenuTraining selectMenuTrainingByTrainId(Long trainId)
    {
        return menuTrainingMapper.selectMenuTrainingByTrainId(trainId);
    }

    /**
     * 查询培训信息列表
     * 
     * @param menuTraining 培训信息
     * @return 培训信息
     */
    @Override
    public List<MenuTraining> selectMenuTrainingList(MenuTraining menuTraining)
    {
        return menuTrainingMapper.selectMenuTrainingList(menuTraining);
    }

    /**
     * 新增培训信息
     * 
     * @param menuTraining 培训信息
     * @return 结果
     */
    @Override
    public int insertMenuTraining(MenuTraining menuTraining)
    {
        menuTraining.setCreateTime(DateUtils.getNowDate());
        return menuTrainingMapper.insertMenuTraining(menuTraining);
    }

    /**
     * 修改培训信息
     * 
     * @param menuTraining 培训信息
     * @return 结果
     */
    @Override
    public int updateMenuTraining(MenuTraining menuTraining)
    {
        menuTraining.setUpdateTime(DateUtils.getNowDate());
        return menuTrainingMapper.updateMenuTraining(menuTraining);
    }

    /**
     * 批量删除培训信息
     * 
     * @param trainIds 需要删除的培训信息主键
     * @return 结果
     */
    @Override
    public int deleteMenuTrainingByTrainIds(Long[] trainIds)
    {
        return menuTrainingMapper.deleteMenuTrainingByTrainIds(trainIds);
    }

    /**
     * 删除培训信息信息
     * 
     * @param trainId 培训信息主键
     * @return 结果
     */
    @Override
    public int deleteMenuTrainingByTrainId(Long trainId)
    {
        return menuTrainingMapper.deleteMenuTrainingByTrainId(trainId);
    }
}
